Repository navigation
Conversation
adriangb
force-pushed
the
mcte-private-fields
branch
from
November 19, 2026 17:17
5b625f0 to
bdf3a4d
Compare
A rule that builds a MaterializedCte with a struct literal or struct update skips the scan check in try_new. Private fields send every new node through try_new, and every in-place change through inputs_mut or with_new_inputs. The fields are pub(crate), so the tree-node and display code of datafusion-expr is unchanged. inputs_mut and into_inputs replace the remaining direct field access in the optimizer and the physical planner.
adriangb
force-pushed
the
mcte-private-fields
branch
from
November 20, 2026 06:15
bdf3a4d to
ffb77b4
Compare
adriangb
marked this pull request as ready for review
November 20, 2026 06:24
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Follow-up to #26274. This PR is stacked on it: only the last commit belongs to this PR. Review #26274 first.
Rationale for this change
#26274 makes the
schemaandprojectionfields ofMaterializedCteScanprivate, so that they always match. TheMaterializedCtenode still has public fields. A rule that builds the node with a struct literal or a struct update skips the scan check inMaterializedCte::try_new.What changes are included in this PR?
MaterializedCtearepub(crate). Downstream code reads them throughid(),name(),body()andcontinuation().MaterializedCte::inputs_mutandMaterializedCte::into_inputsreplace the direct field access in the optimizer driver,TypeCoercion,DecorrelatePredicateSubquery,PushDownFilter,OptimizeProjectionsand the physical planner.try_new, so the scans are checked.Are these changes tested?
Yes, by the existing tests. The change does not change behavior.
Are there any user-facing changes?
Yes. This is a breaking API change, which the 57.0.0 upgrade guide describes.